package com.xinweisi.dataserver.timertask;

import com.xinweisi.dataserver.module.memberdata.user.UserService;
import com.xinweisi.dataserver.util.UserUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Data
@Slf4j
@Component
@EnableScheduling
public class MyTimerTask {
    @Autowired
    UserService userService;

    @Scheduled(cron = "0 0 1 * * ?")
    public void run() {
        log.info("**********我是定时任务清除Redis**********");
        RedisClear.clearRedis();
        UserUtil.size = 0;
    }
}

